package com.yudaxian.demo;

import io.netty.buffer.ByteBuf;
import io.netty.buffer.Unpooled;

import java.nio.charset.StandardCharsets;
import java.util.Arrays;

/**
 * @Author: yudaxian
 * @Description: TODO
 * @DateTime: 2024/8/17 18:03
 **/
public class ByteBufStudy {
    public static void main(String[] args) {
        ByteBuf buf = Unpooled.buffer(10);    //容量只有10字节
        System.out.println(buf.capacity());
        //直接写一个字符串
        buf.writeCharSequence("卢本伟牛逼！", StandardCharsets.UTF_8);   //很明显这么多字已经超过10字节了
        System.out.println(buf.capacity());
    }
}
